<?php
$flags_dir = "img/flags/16/";
//--------------------------------------------------
//	Filename: country_select.php
//--------------------------------------------------
//		Information:
// Include this file to print a selection box for 
// selecting country.
//--------------------------------------------------
if( !defined('IN_INDEX') )
{
	die('The content of this page is hidden.');
}
$selected_country = "";
if(isset($preselected_country))
{
	$selected_country = $preselected_country;
}

// Drop down list for selecting country. Selections availible are stored in $COUNTRY_LIST.
echo "<select name=\"country_list\">\n
	<option value=\"\">" . ucfirst(translate('country')) . "</option>";
foreach($COUNTRY_LIST as $key => $val)
{										
	if(strtoupper($val['country_iso']) == strtoupper($selected_country))
	{
		echo "<option style=\"background: url('" . $flags_dir . strtolower($val['country_iso']) . ".png') no-repeat #fff; padding-left: 20px;\" value=\"" . $val['country_iso'] . "\" selected=\"selected\">" . translate(ucfirst(strtolower($val['country_name']))) . "</option>\n";
	}
	else
	{
		echo "<option style=\"background: url('" . $flags_dir . strtolower($val['country_iso']) . ".png') no-repeat #fff; padding-left: 20px;\" value=\"" . $val['country_iso'] . "\">" . translate(ucfirst(strtolower($val['country_name']))) . "</option>\n";
	}
}
echo "</select>\n";
?>